package com.tuo51.foudation.constant;

import lombok.Setter;

/**
 * *******************************
 * Created by Ron.
 * form com.tuo51
 * on 2017/8/4
 * *******************************
 */
public class LiveRecordConstant {

    public enum MediaType{
        IMG(1, "图片"),
        VIDEO(2, "视频");

        @Setter
        private int code;

        @Setter
        private String value;

        MediaType(int code, String value){
            this.code = code;
            this.value = value;
        }

        public int codeOf(){
            return code;
        }

        public String valueOf(){
            return value;
        }

        public MediaType get(int code){
            for (MediaType mediaType : values()) {
                if (mediaType.codeOf()==code)
                    return mediaType;
            }
            return null;
        }
    }

}
